<?php

class FormAction_View extends FormAction
{

  protected $action = Form::ACTION_VIEW;

  public function __construct(Form $form)
  {
    parent::__construct($form);
  }

  public function execute()
  {
    $this->loadData();
  }

  public function render()
  {
    $view = $this->getView();
    $view->set('data', $this->getIterator());
    return parent::render();
  }

  public function loadData()
  {
    foreach ((array) $this->form->getId() as $id) {
      $row = $this->gateway()->find($id);
      $this->data[] =& $row;
    }
  }

}
